Skip to content

fix(TOOLS): declare graphology deps for MemoryGraph.ts#1407

Closed
Luo0oo wants to merge 1 commit into
danielmiessler:mainfrom
Luo0oo:fix/memorygraph-missing-deps
Closed

fix(TOOLS): declare graphology deps for MemoryGraph.ts#1407
Luo0oo wants to merge 1 commit into
danielmiessler:mainfrom
Luo0oo:fix/memorygraph-missing-deps

Conversation

@Luo0oo

@Luo0oo Luo0oo commented Jul 3, 2026

Copy link
Copy Markdown

Bug

LifeOS/install/LifeOS/TOOLS/MemoryGraph.ts imports three npm packages that are not declared in any package.json in the repo:

import Graph from "graphology";
import louvain from "graphology-communities-louvain";
import pagerank from "graphology-metrics/centrality/pagerank";

find LifeOS/install -name package.json | xargs grep -l graphology returns nothing. Fresh installers hit Cannot find module 'graphology' the first time they invoke bun ~/.claude/LIFEOS/TOOLS/MemoryGraph.ts build, which silently breaks Pulse's /api/memory/graph route (returns empty graph.json with the "run: bun LIFEOS/TOOLS/MemoryGraph.ts build --all" hint that then also fails).

Fix

Adds LifeOS/install/LifeOS/TOOLS/package.json declaring the 3 direct deps with ^ caret ranges (matching the house style used by sibling manifests like TOOLS/TokenXray/package.json and PULSE/Observability/package.json).

Uses parent-directory scope deliberately, rather than moving MemoryGraph.ts into a TOOLS/MemoryGraph/ subdir to match the exact sibling pattern of TOOLS/llcli/ and TOOLS/TokenXray/. Moving the file would break every existing consumer path:

  • LifeOS/install/LifeOS/PULSE/Observability/observability.tshandleMemoryGraphApi() reads MEMORY/GRAPH/graph.json built by this exact path
  • PULSE/modules/user-index.ts references
  • LIFEOS_INSTALL/engine/detect.ts + actions.ts install-time refs

Deliberate deviation is documented in the manifest's description field.

Reproducer

curl -fsSL https://ourlifeos.ai/install.sh | bash
bun ~/.claude/LIFEOS/TOOLS/MemoryGraph.ts build
# error: Cannot find module 'graphology'

After this PR, adds bun install in LIFEOS/TOOLS/ (or bun resolves via the parent walk) and the build succeeds.

Verify

cd LifeOS/install/LifeOS/TOOLS && bun install && bun MemoryGraph.ts build succeeds.

MemoryGraph.ts imports graphology, graphology-communities-louvain, and
graphology-metrics but no package.json in the repo declares them, so fresh
installers hit 'Cannot find module graphology' the first time they run:

  bun ~/.claude/LIFEOS/TOOLS/MemoryGraph.ts build

Adds a parent-directory package.json at LifeOS/install/LifeOS/TOOLS/ so
Bun's module resolver walks up and finds the deps. Sibling tool subdirs
(TOOLS/llcli/, TOOLS/TokenXray/) keep their own scoped package.json;
scripts sitting at TOOLS/ root inherit from here.

Deliberate parent-scope location instead of moving MemoryGraph.ts into a
TOOLS/MemoryGraph/ subdir — the move would break every existing consumer
path including Pulse Observability's /api/memory/graph route and the
install engine references.
@danielmiessler

Copy link
Copy Markdown
Owner

Thanks a lot for this, @Luo0oo — really appreciate you flagging it and taking the time to write the fix.

When I went back through the current source, this turns out to already be handled: graphology deps for MemoryGraph.ts are already declared in TOOLS/package.json in current source. The system has moved a fair bit since you opened this (the PAI → LifeOS rename and a few subsystem rewrites), so the gap you spotted has since been closed independently.

Going to close this one out on that basis — but genuinely grateful for the contribution. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants